From: Raghuveer Kasaraneni Date: Mon, 21 Mar 2022 18:24:25 +0000 (+0100) Subject: dateMenu: Limit timezone offset hours to integers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~480^2^2~67 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0e45273330288370dc6bad630db4159f5a2b104f;p=gnome-shell.git dateMenu: Limit timezone offset hours to integers If the timezone offset calculation in the World Clocks contains non-zero minutes, then a decimal Hours value is being displayed. Limit the Hours value to integers by using Math.floor(). Part-of: --- diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 71b932ad7..ca98cdd24 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -467,7 +467,8 @@ class WorldClocksSection extends St.Button { const localOffset = GLib.DateTime.new_now_local().get_utc_offset(); const utcOffset = GLib.DateTime.new_now(tz).get_utc_offset(); const offsetCurrentTz = utcOffset - localOffset; - const offsetHours = Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR; + const offsetHours = + Math.floor(Math.abs(offsetCurrentTz) / GLib.TIME_SPAN_HOUR); const offsetMinutes = (Math.abs(offsetCurrentTz) % GLib.TIME_SPAN_HOUR) / GLib.TIME_SPAN_MINUTE;